package service.product.machining;


import entity.Machining;
import entity.ResponseMessage;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @description:  工艺管理
 *
 * @author: Cheng
 *
 * @create: 2022-04-18 17:50
 **/
@Component
public interface MachiningAPI {



    /**
     * 加工工艺检查是否重名
     *
     * @param name
     * @return ResponseMessage
     */
    @RequestMapping("selectInsrtCheckName")
    @ResponseBody
    public ResponseMessage selectInsrtCheckName(@RequestParam("name") String name);


    /**
     * 添加一条加工管理信息
     * @param machining
     * @return
     */
    @RequestMapping("insertMachiningInfo")
    @ResponseBody
    public ResponseMessage insertMachiningInfo(@RequestBody Machining machining);



    /**
     * 分页查询加工工艺信息
     * @param pageNum
     * @param name
     * @param sort
     * @return ResponseMessage
     */
    @RequestMapping("selectMachiningInfo")
    @ResponseBody
    public ResponseMessage selectMachiningInfo(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                               @RequestParam(value = "name",defaultValue = "")String name,
                                               @RequestParam(value = "sort",defaultValue = "ASC")String sort);


    /**
     * 根据id查询加工工艺信息
     * @param id
     * @return
     */
    @RequestMapping("selectMachiningById")
    @ResponseBody
    public ResponseMessage selectMachiningById(@RequestParam("id") String id);


    /**
     * 根据id更新加工工艺
     * @param machining
     * @return
     */
    @RequestMapping("updateMachiningInfo")
    @ResponseBody
    public ResponseMessage updateMachiningInfo(@RequestBody Machining machining);


}
